package com.zbkj.dal.feign.vo;

import com.fasterxml.jackson.annotation.JsonAlias;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;

/**
 * @author luozunhong
 * @date 2020/11/25 16:47
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class WeWorkUserInfoVO extends BaseResponse {
    @JsonAlias("userid")
    private String wxUserId;

    private String name;

    private String alias;

    private String mobile;

    private List<Integer> department;

    private String position;

    private Integer gender;

    private String email;

    private String telephone;

    @JsonAlias("avatar_mediaid")
    private String avatar;

    private Boolean enable;

    private Extattr extattr;

    @JsonAlias("to_invite")
    private Boolean invite;

    private String address;

    private String openUserId;

    @JsonAlias("external_profile")
    private ExternalProfile externalProfile;

    @JsonAlias("external_position")
    private String externalPosition;

    @Data
    public static class Extattr {
        private List<ExternalAttr> attrs;
    }

    @Data
    public static class ExternalProfile {
        @JsonAlias("external_corp_name")
        private String externalCorpName;
        @JsonAlias("external_attr")
        private List<ExternalAttr> externalAttr;
    }

    @Data
    public static class ExternalAttr {
        private Integer type;
        private Integer name;
        private Text text;
        private Web web;
        @JsonAlias("miniprogram")
        private MiniProgram miniProgram;
    }

    @Data
    public static class Text {
        private String value;
    }

    @Data
    public static class Web {
        private String url;
        private String title;
    }

    @Data
    public static class MiniProgram {
        @JsonAlias("appid")
        private String appId;
        @JsonAlias("pagepath")
        private String pagePath;
        private String title;
    }
}
